﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;
using System.Windows.Media;

namespace ThreeByte.ActiveDeck.Converters
{
    public class ScaleToFillConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            return (System.Convert.ToBoolean(value) ? Stretch.UniformToFill : Stretch.Uniform);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) {
            if(value is Stretch){
                return ((Stretch)value) == Stretch.UniformToFill;
            }
            return false;
        }
    }
   
}
